package main

import (
	"fmt"
	"sync"
)

func main() {
	u := user{}
	//u:=new(user)
	u.lock.Lock()
	u.name = "张三"
	u.lock.Unlock()
	fmt.Println(u)
}
type user struct {
	lock sync.Mutex
	name string
	age int
}
